<?xml version="1.0" encoding="UTF-8"?>

<!--
    Document   : information.xsl
    Created on : September 30, 2013, 7:53 PM
    Author     : mrnghiep
    Description:
        Purpose of transformation follows.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html" indent="yes"/>
    
    <xsl:param name="type" select="''"/>
    
    <xsl:template match="/">
        <xsl:if test="$type='LOST'">
            <xsl:call-template name="lost">
                <xsl:with-param name="cate" select="'L'"/>
            </xsl:call-template>
        </xsl:if>

        <xsl:if test="$type='COLLECT'">
            <xsl:call-template name="lost">
                <xsl:with-param name="cate" select="'C'"/>
            </xsl:call-template>
        </xsl:if>
    </xsl:template>
    <xsl:template name="lost">
        <xsl:param name="cate" select="''"/>
        <xsl:for-each select="informations/information[category=$cate]">
            <xsl:variable name="id" select="id"/>
            <div class="question_list">
                <h3>
                    <a href="detail.jsp?id={$id}" rel="bookmark">
                        <xsl:value-of select="category" />
                        <xsl:value-of select="id" /> -
                        <xsl:value-of select="owner"/> -
                        <xsl:value-of select="info" />
                    </a>
                </h3>
                <span class="post-time">
                    <xsl:value-of select="date" />
                </span>
                <br/>
                <p>
                    <span class="pcate">
                        <a href="http://www.timgiayto.com/c/bang-lai-xe" title="View all posts in Bằng lái xe" rel="category tag">Bằng lái xe</a>,
                        <a href="http://www.timgiayto.com/c/cmnd" title="View all posts in CMND" rel="category tag">CMND</a>,
                        <a href="http://www.timgiayto.com/c/giay-to-xe" title="View all posts in Giấy tờ xe" rel="category tag">Giấy tờ xe</a>,
                        <a href="http://www.timgiayto.com/c/the-atm-tin-dung" title="View all posts in Thẻ ATM, tín dụng" rel="category tag">Thẻ ATM, tín dụng</a>
                    </span>
                </p>
            </div>
        </xsl:for-each>
    </xsl:template>

</xsl:stylesheet>
